

<template>
  <div class="index">
    <div class="formBox">
        <p class="item"><span class="name">用户id ：</span><input v-model="date.user_id" class="solt" placeholder="请输入内容"></input></p>
        <p class="item"><span class="name">超级管理员 ：</span>
            <select v-model="date.is_super">
              <option value ="0">否</option>
              <option value="1">是</option>
            </select>
        </p>
        <p class="item inputBox"><button @click="submit" class="submitInput">确定</button><button @click="empty" class="emptyInput">重置</button></p>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'
import axios from 'axios'
import { Get, Post ,Put ,Delete} from '@/config/api'

export default {
  name: 'index',
  data() {
    return {
        list:[],
        date:{
          user_id:'',
          is_super:0
        }
    }
  },
  mounted(){

  },
  methods: {

    //提交
    async submit() {
      if(this.Check()){
        let data={
              "user_id":this.date.user_id,
              "is_super":this.date.is_super
          }
        let reg=await Post('/admin',this.$store.state.token,data)
        alert('添加成功')
        this.$router.push('/adminList')
      }

    },
    //清空
    empty() {

    }
  }
}

</script>

